home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10961 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.uminho.pt!newsadm
  2. From: Jose Exposto <mesexp@di.uminho.pt>
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: Problem with generic classes in libg++
  5. Date: Tue, 12 Mar 1996 01:23:27 +0100
  6. Organization: Universidade do Minho
  7. Message-ID: <3144C3FF.7462@di.uminho.pt>
  8. NNTP-Posting-Host: orpheu.ci.uminho.pt
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. Hello,
  15.  
  16. When I try to define 2 generic Splay Sets of diferent types from libg++ 
  17. I get a weird link error:
  18.  
  19.     Doc.Splay.Set (.data+0x0): multiple definition of '_dummy_null'
  20.     String.Splay.Set (.data+0x0): first defined here
  21.  
  22. Classes Doc and String are the two types for which I want to make a Set.
  23. String is the class String from libg++ and Doc is a class I'm define:
  24.  
  25.     class Doc: public StringSplaySet{
  26.         ....
  27.     }
  28.  
  29. I build the generic code using:
  30.  
  31.     genclass String val defs
  32.     genclass String val Set
  33.     genclass String val SplaySet
  34.     genclass String val SplayNode (this one I wasn't expecting, but 
  35. I had to build it as well).
  36.  
  37. Now I have class StringSplaySet working good.
  38. When I declare a class Cluster:
  39.  
  40.     class Cluster: public DocSplaySet{
  41.         ....
  42.     }
  43.  
  44. where DocSplaySet if build using:
  45.  
  46.     genclass Doc val defs
  47.     genclass Doc val Set
  48.     genclass Doc val SplaySet
  49.     genclass Doc val SplayNode.
  50.  
  51. When I put it all together the link error above shows up. I apreciate 
  52. any feedback on the problem.
  53. Thanks
  54.  
  55. -- 
  56. +---------------------------------------------------------------------+
  57. | Jose Luis Padrao Exposto                                            |
  58. |     Department of Informatics, University of Minho                  | 
  59. | <mailto:mesexp@di.uminho.pt> <URL:http://alfa.di.uminho.pt/~mesexp> |
  60. | voice : +351-53-616969       fax : +351-53-616969                   |
  61. +---------------------------------------------------------------------+
  62.  
  63.